<template>
  <div class="modify">
    <my-head title="修改昵称" :go="true" ri="保存"></my-head>
    <div class="content">
      <div class="list">
        <div class="item">
          <input type="text" :placeholder="val">
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Head from '@/components/Head'
export default {
  data(){
    return {
       val:""
    }
  },
  created(){
    var id = this.$route.query.id
    this.$http.get("../../../../static/json/user.json").then((res)=>{
      console.log(res.data.userinfo)
      var data = res.data.userinfo
      for( var i=0;i<data.length;i++){
        if(data[i].userid == id){
          this.val = data[i].nickname;
        }
      }
    })
  },
  components:{
    myHead:Head
  }
}
</script>

<style scoped lang='less'>
  .modify{
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    .content{
      flex: 1;
      background: #f4f4f4;
      .list{
        margin-top:0.2rem;
        .item{
          background: #fff;
          padding: 0.15rem 0.16rem;
          display: flex;
          input{
            flex: 1;
            border: 0;
            outline: none;
            font-size: 0.16rem;
          }
        } 
      }
    }
  }
</style>
